|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectcontrolP5.Controller
controlP5.Bang
public class Bang
a bang controller triggers an event when pressed. A bang can only be assigned to a function in your program but not to a field like other controllers. Bang extends superclass Controller, for a full documentation follow this link, controller.
/** * ControlP5bang
* A bang doesnt have a value but only triggers an event that can be received by a * function named after the bang's name or parsing an event inside the controlEvent function. * By default a bang is triggered when pressed but this can be changed to 'release' * using theBang.setTriggerEvent(Bang.RELEASE).
* for implementation details see controlP5/Bang
* related examples ControlP5button
* by Andreas Schlegel 2010
* */ import controlP5.*; ControlP5 controlP5; int myColorBackground = color(0,0,0); color[] col = new color[] { color(100), color(150), color(200), color(250) }; void setup() { size(400,400); frameRate(30); controlP5 = new ControlP5(this); for(int i=0;i
| Field Summary |
|---|
| Fields inherited from interface controlP5.ControlP5Constants |
|---|
acceptClassList, ACTIVE, ALT, ARC, ARRAY, BACKSPACE, BOOLEAN, BOTTOM, CENTER, CONTROL, controlEventClass, CUSTOM, DECREASE, DEFAULT, DELETE, DOWN, ELLIPSE, ENTER, ESCAPE, EVENT, eventMethod, FIELD, FLOAT, HALF_PI, HIDE, HIGHLIGHT, HORIZONTAL, IMAGE, INCREASE, INTEGER, INVALID, KEYCONTROL, LEFT, LINE, LOAD, MENU, METHOD, MOVE, OVER, PI, PRESSED, PRINT, RELEASE, RESET, RIGHT, SAVE, SHIFT, SPRITE, STRING, SWITCH, SWITCH_BACK, SWITCH_FORE, TAB, TOP, TWO_PI, UP, VERBOSE, VERTICAL |
| Method Summary | |
|---|---|
void |
addToXMLElement(ControlP5XMLElement theElement)
|
void |
setTriggerEvent(int theEventID)
by default a bang is triggered when the mouse is pressed. |
void |
setValue(float theValue)
set the value of the bang controller. |
java.lang.String |
toString()
|
void |
update()
updates the value of the controller without having to set the value explicitly. |
void |
updateDisplayMode(int theMode)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public void setTriggerEvent(int theEventID)
theEventID - public void setValue(float theValue)
setValue in class ControllertheValue - floatpublic void update()
Controller
update in interface ControllerInterfaceupdate in class Controllerpublic void addToXMLElement(ControlP5XMLElement theElement)
theElement - ControlP5XMLElementpublic void updateDisplayMode(int theMode)
public java.lang.String toString()
toString in class Controller
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||